#ifndef IO_THREAD_POOL_H
#define IO_THREAD_POOL_H
#include <vector>
#include <memory>
#include <boost/asio.hpp>

using namespace std;

class IOThreadPool
{
public:
	IOThreadPool();
	~IOThreadPool();

	void run();
	void stop();

	boost::asio::io_service& getIOService();

private:
	void init();

private:
	typedef std::shared_ptr<boost::asio::io_service> io_service_ptr;
	typedef std::shared_ptr<boost::asio::io_service::work> work_ptr;

	std::size_t			next_io_service_;
	vector<io_service_ptr>  io_services_;
	std::vector<work_ptr>   works_;
};

#endif
